package middleware
import (
	"github.com/iris-contrib/middleware/cors"
	"github.com/kataras/iris/v12"
)

func Cors(app *iris.Application)  {
	crs := cors.New(cors.Options{
		AllowedOrigins:   []string{"*"}, // allows everything, use that to change the hosts.
		AllowedMethods:   []string{"GET", "POST", "PUT", "PATCH", "DELETE","HEADER","OPTIONS", },
		AllowedHeaders:   []string{"*"},
		AllowCredentials: true,
	})

	app.UseRouter(crs)
}
